﻿@using WSCeCommerce.Domain
@using WSCeCommerceWeb.Helpers

@model WSCeCommerce.Domain.Sale

@{
    ViewBag.Title = "Order Confirmed";
}

<h2>Order Confirmed</h2>
<p>
    You order number @Model.SaleId has been confirmed. An order confirmation will be emailed to you.
        <h3>Items</h3>
<table>
    <tr style="font-size: large">
        <td>Item</td>
        <td>Price</td>
        <td>Quantity</td>
        <td>Total</td>
    </tr>
    @foreach (SaleItem item in Model.SaleItems)
    { 
        <tr>
            <td>@item.Item.Name</td>
            <td>@item.Price</td>
            <td>@item.Quantity</td>
            <td>@(item.Price * item.Quantity)</td>

        </tr>
    }

    <tr>
        <td><b>Total</b></td>
        <td />
        <td />
        <td><b>@Model.Total</b></td>
    </tr>
</table>

    <h3>Shipping Adrress</h3>

    @if (!String.IsNullOrEmpty(Model.ShipToAddress.AddressLine1))
    {
        @Html.ValueFor(model => model.ShipToAddress.AddressLine1);<br />
    }
    @if (!String.IsNullOrEmpty(Model.ShipToAddress.AddressLine2))
    {
        @Html.ValueFor(model => model.ShipToAddress.AddressLine2);<br />
    }

    @if (!String.IsNullOrEmpty(Model.ShipToAddress.City))
    {
        @Html.ValueFor(model => model.ShipToAddress.City);<br />
    }

    @if (!String.IsNullOrEmpty(Model.ShipToAddress.Country))
    {
        @Html.ValueFor(model => model.ShipToAddress.Country);<br />
    }

    @if (!String.IsNullOrEmpty(Model.ShipToAddress.Zip))
    {
        @Html.ValueFor(model => Model.ShipToAddress.Zip);<br />
    }

</p>

